<?php

namespace App\Http\Controllers\Otc;

use App\Http\Controllers\Controller;
use App\Models\RechPrice;
use App\Models\UsdtPrice;

//通用方法
class PublicController extends Controller
{
    /**
     * 后台设置的usdt买入卖出价格
     * 后台设置的广告单价格区间列表
     * @author hxq
     * @return [type] [description]
     */
    public function rech_public_fit()
    {
        $data = [];
        //查找当前设置的usdt价格
        $price                = UsdtPrice::find(1);
        $data['buy_price']    = $price->buy_price ?? 0;
        $data['seller_price'] = $price->seller_price ?? 0;
        //查找后台设置的价格区间
        $sections         = RechPrice::select('value')->get();
        $data['sections'] = $sections;

        return response()->json(['status' => 1, 'msg' => '查询成功', 'data' => $data]);
    }
}
